
<%@ page import="mybatis.pojo.Student" %>
<%@ page import="mybatis.services.StudentService" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Date" %>
<%--
  Created by IntelliJ IDEA.
  User: Dell
  Date: 2022/7/4
  Time: 17:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%

    request.setCharacterEncoding("utf-8");
    Long id =Long.parseLong( request.getParameter("id"));
    out.print(id);
    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
    request.setCharacterEncoding("utf-8");
    String sname = request.getParameter("sname");
    String gender = request.getParameter("gender");
    String tel = request.getParameter("tel");
    String qq = request.getParameter("qq");
    String wechat = request.getParameter("wechat");
    int gradeId = Integer.parseInt(request.getParameter("gradeId"));
    Date enterDate = simpleDateFormat.parse(request.getParameter("enterDate"));
    String city = request.getParameter("city");
    Date birth = simpleDateFormat.parse(request.getParameter("birth"));
    String address = request.getParameter("address");
    String psd = request.getParameter("psd");
    String idCard = request.getParameter("idCard");


    Student student = new Student();
    student.setStuno(id);
    student.setSname(sname);
    student.setSex(gender);
    student.setTelephone(tel);
    student.setQq(qq);
    student.setWechat(wechat);
    student.setGradeid(gradeId);
    student.setEnterdate(enterDate);
    student.setFromcity(city);
    student.setBirthday(birth);
    student.setAddress(address);
    student.setPass(psd);
    student.setIdcardpic(idCard);
    int update = StudentService.ME.update(student);
    if (update > 0) {
        out.print("修改成功");
    } else {
        out.print("修改失败");
    }
%>

</body>
</html>
